<div class="modal-header">
  <h3>编辑设备</h3>
</div>
<form class="g-my-form container" [formGroup]="formGroup" (ngSubmit)="submit()">
  <div class="modal-body">
    <div class="form-group required col-4">
      <label>
        设备别名：
      </label>
      <input class="form-control w35" formControlName="alias_name" maxlength="20" required />
      <div class="invalid-feedback" *ngIf="formGroup.get('alias_name').errors as errors">
        <span *ngIf="errors.required">
          设备别名不允许为空
        </span>
      </div>
    </div>
    <div class="form-group col-10">
      <div class="form-group required">
        <label class="" for="remaining_date">有效期至</label>
        <input class="form-control" name="dp" ngbDatepicker #d="ngbDatepicker" formControlName="remaining_date">
        <button class="btn btn-primary" (click)="d.toggle()" type="button">
          <i class="la la-calendar"></i>
        </button>
      </div>
      <div class="form-check ml-3">
        <input class="form-check-input" type="checkbox" formControlName="permanent" (change)="(permanent())" value="false">
        <label class="form-check-label" for="inlineCheckbox1">永久有效</label>
      </div>
    </div>
    <div class="form-group form-inline col-12">
      <label for="remarks">备注</label>
      <input id="remarks" name="des" type="text" maxlength="100" class="form-control" formControlName="remarks" />
    </div>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-secondary" (click)="cancel()">
      取消
    </button>
    <button class="btn btn-primary" [disabled]="submitting">保存</button>
  </div>
</form>